package com.xtx.air.bo.role.impl;

import com.xtx.air.bo.role.IRoleBO;
import com.xtx.air.dao.role.IRoleDAO;
import com.xtx.air.dataobject.RoleDO;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import java.util.Collections;
import java.util.List;

/**
 * User: hanyi
 * Date: 12-2-9
 * Time: 下午10:46
 */
public class RoleBOImpl implements IRoleBO{
    private Log logger = LogFactory.getLog(this.getClass());
    private IRoleDAO roleDAO;

    public void setRoleDAO(IRoleDAO roleDAO) {
        this.roleDAO = roleDAO;
    }

    @Override
    public List<RoleDO> findRole(RoleDO role) {
        try{
            return roleDAO.findRole(role);
        }catch (Exception e){
            logger.error("查询角色失败",e);
            return Collections.EMPTY_LIST;
        }
    }
}
